<?php

header("Cache-Control: no-cache, must-revalidate");

//Me conecto a la base MySQL
define('__ROOT__', dirname(__FILE__));
require_once(__ROOT__ . '/connection.php');

$query = "SELECT MAX(nro_orden) FROM Orden;";
$result = $mysql->query($query);
if ($result) {
    $row = $result->fetch_array(MYSQLI_NUM);
    echo ($row[0] + 1);
    $result->free;
}

$mysql->close;
?>
